0<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script th:src="@{/js/axios.js}"></script>
    <script th:src="@{/js/vue.js}"></script>
    <link rel="stylesheet" th:href="@{/js/el/theme-chalk/index.css}">
    <script th:src="@{/js/el/index.js}"></script>
</head>
<body>
    <div id="app">
        <img src="/img/0.jpeg" width="100%" height="100%" style="filter: blur(30px);" />
        <el-dialog title="提示" :visible.sync="show" width="30%" :close-on-click-modal="ifshow"
                   :close-on-press-escape="ifshow" :show-close="ifshow">
            <div style=" text-align:center">
                <el-form :model="user">
                    <el-form-item >
                        <el-input v-model="user.name" placeholder="用户名">
                        </el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-input v-model="user.pwd" placeholder="密码">
                        </el-input>
                    </el-form-item>
                    <span>
                        <el-button  type="primary" @click="login()">登录</el-button>
                        <el-button type="primary"  @click="goIndex()">返回首页</el-button>
			        </span>
                </el-form>
            </div>
        </el-dialog>
    </div>
</body>
    <script>
        new Vue({
            el:"#app",
            data(){
                return{
                    show:true,
                    ifshow:false,
                    user:{name:null,pwd:null}
                }
            },
            methods:{
                goIndex(){
                    window.location.href="/api/public/goIndex"
                },
                login(){
                    var that = this
                    var fd = new FormData()
                    fd.append("username",this.user.name)
                    fd.append("password",this.user.pwd)
                    axios.post("/doLogin",fd,{'Content-Type':'multipart/form-data'}).then(
                        function (resp) {
                            console.log(resp)
                            window.location.href=resp.data.action;
                        }
                    )
                }

            },
            mounted(){

            }
        })
    </script>
</html>